package org.jeecg.modules.app.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.api.member.entity.Member;
import org.jeecg.modules.api.withdraw.entity.WithdrawRecord;
import org.jeecg.modules.api.withdraw.service.IWithdrawRecordService;
import org.jeecg.modules.app.service.ITeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description: 提现接口
 * @author: Young Jun
 * @date: 2024年09月24日 11:39
 */
@Api(tags = "提现接口")
@RestController
@RequestMapping("/app/withdraw")
@Slf4j
public class WithdrawController {

    @Autowired
    private IWithdrawRecordService withdrawRecordService;

    @ApiOperation(value = "提现提交", notes = "提现提交")
    @PostMapping("/submit")
    public Result<WithdrawRecord> submit(@RequestBody String req) {
        log.info("submit:{}",req);
        return Result.OK(withdrawRecordService.submit(req));
    }

    @ApiOperation(value = "提现记录", notes = "提现记录列表")
    @GetMapping("/getRecordList")
    public Result<Page<WithdrawRecord>> getRecordList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                                      @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
        return Result.OK(withdrawRecordService.getRecordList(pageNo,pageSize));
    }
}
